<?php
/**
 * Created by PhpStorm.
 * User: 戎大富
 * Date: 2019/3/29
 * Time: 17:08
 * 收货地址信息
 */
namespace app\admin\controller;
use think\Db;
use think\Request;
class Receiving extends Base {
    public function index(){
        if(Request::instance()->isPost()){
            $receiving_name = input('receiving_name');//内容
            $receiving_phone = input('receiving_phone');//内容
            $receiving_address = input('receiving_address');//内容
            $data['receiving_name'] = $receiving_name;
            $data['receiving_phone'] = $receiving_phone;
            $data['receiving_address'] = $receiving_address;
            $res = Db::table('up_receiving')->where('receiving_id', 1)->update($data);
            if($res){
                return json(['code' => 200, 'msg' => '编辑成功']);
            }else{
                return json(['code' => 100, 'msg' => '编辑失败']);
            }
        }
        $res = Db::table('up_receiving')->where('receiving_id', 1)->find();
        $this->assign('res', $res);
        return $this->fetch();
    }
}